package com.aispace.taichu.modules.listener;

import lombok.AllArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
public class TaiChuEventPublisher {

    private final ApplicationEventPublisher eventPublisher;

    public <T> void publishChange(T entity) {
        eventPublisher.publishEvent(new TaiChuEvent<>(this, entity));
    }
}
